-
Notifications
You must be signed in to change notification settings - Fork 580
uneven sharding for sharded tensor pool #3533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
708ddb1 to
3f268a1
Compare
faran928
added a commit
to faran928/torchrec
that referenced
this pull request
Nov 11, 2025
… pool (meta-pytorch#3533) Summary: A few changes in the diff: 1. Support to proportionally shard the tensor pool based on memory capacity per rank. 2. Using block_bucketize_sparse_features_inference to return bucket_mapping that can be used during request batching in inference w/ custom sigrid predictor engine 3. Wrapping some of the operations with fx wrappers to make it compatible with model split boundaries for DLRM serving where embeddings are sharded and split onto different pytorch modules 4. Exposing set_device() api to some of the modules if we want to place some shards to cpu while others to cuda. 5. Move _get_unbucketize_tensor_via_length_alignment to common util files. Differential Revision: D79603009
4e20f9e to
bb2739b
Compare
faran928
added a commit
to faran928/torchrec
that referenced
this pull request
Nov 12, 2025
… pool (meta-pytorch#3533) Summary: A few changes in the diff: 1. Support to proportionally shard the tensor pool based on memory capacity per rank. 2. Using block_bucketize_sparse_features_inference to return bucket_mapping that can be used during request batching in inference w/ custom sigrid predictor engine 3. Wrapping some of the operations with fx wrappers to make it compatible with model split boundaries for DLRM serving where embeddings are sharded and split onto different pytorch modules 4. Exposing set_device() api to some of the modules if we want to place some shards to cpu while others to cuda. 5. Move _get_unbucketize_tensor_via_length_alignment to common util files. As part of this diff, also had to update some of the test cases. Mainly because updating the forward path a bit leads to reorganization of return values of remote module in the test cases leading to reorganization of batchinfo for each of those output. Baseline test Full Output: https://www.internalfb.com/intern/everpaste/?handle=GMpN0B-VwcKcvAgDAB_hIkOvKrJNbsIXAAAB&phabricator_paste_number=2035160680 Remote graph: https://www.internalfb.com/intern/everpaste/?color=0&handle=GDe4BCBV-XwTNLoEAOTnVbCneb1jbr0LAAAz Output order: (_item_embedding_index_values_tensor_pool__local_shard_pools_0, _item_embedding_index_values_tensor_pool__local_shard_pools_1, getitem_6, getitem_10, getitem_9) After changes Full Output: https://www.internalfb.com/intern/everpaste/?handle=GIb_pSL6TjHawBgEALDgarUck4YhbsIXAAAB&phabricator_paste_number=2035191658 Remote graph: https://www.internalfb.com/intern/everpaste/?color=0&handle=GFmFkB9waX3elzMGAJr9zTcLZiIDbr0LAAAz Output Order: getitem_6, _item_embedding_index_values_tensor_pool__local_shard_pools_0, _item_embedding_index_values_tensor_pool__local_shard_pools_1, getitem_10, getitem_9 getitem_6 is shifted first after changes. Differential Revision: D79603009
… pool (meta-pytorch#3533) Summary: A few changes in the diff: 1. Support to proportionally shard the tensor pool based on memory capacity per rank. 2. Using block_bucketize_sparse_features_inference to return bucket_mapping that can be used during request batching in inference w/ custom sigrid predictor engine 3. Wrapping some of the operations with fx wrappers to make it compatible with model split boundaries for DLRM serving where embeddings are sharded and split onto different pytorch modules 4. Exposing set_device() api to some of the modules if we want to place some shards to cpu while others to cuda. 5. Move _get_unbucketize_tensor_via_length_alignment to common util files. As part of this diff, also had to update some of the test cases. Mainly because updating the forward path a bit leads to reorganization of return values of remote module in the test cases leading to reorganization of batchinfo for each of those output. Baseline test Full Output: https://www.internalfb.com/intern/everpaste/?handle=GMpN0B-VwcKcvAgDAB_hIkOvKrJNbsIXAAAB&phabricator_paste_number=2035160680 Remote graph: https://www.internalfb.com/intern/everpaste/?color=0&handle=GDe4BCBV-XwTNLoEAOTnVbCneb1jbr0LAAAz Output order: (_item_embedding_index_values_tensor_pool__local_shard_pools_0, _item_embedding_index_values_tensor_pool__local_shard_pools_1, getitem_6, getitem_10, getitem_9) After changes Full Output: https://www.internalfb.com/intern/everpaste/?handle=GIb_pSL6TjHawBgEALDgarUck4YhbsIXAAAB&phabricator_paste_number=2035191658 Remote graph: https://www.internalfb.com/intern/everpaste/?color=0&handle=GFmFkB9waX3elzMGAJr9zTcLZiIDbr0LAAAz Output Order: getitem_6, _item_embedding_index_values_tensor_pool__local_shard_pools_0, _item_embedding_index_values_tensor_pool__local_shard_pools_1, getitem_10, getitem_9 getitem_6 is shifted first after changes. Differential Revision: D79603009
bb2739b to
cccadf3
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
fb-exported
meta-exported
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary: trochrec uneven sharding changes
Differential Revision: D79603009